<?php
//管理员模型
namespace Admin\Model;
use Think\Model;

/**
 * 用户模型
 */
class managerModel extends Model{
    
    protected $tableName = 'manager';

    /**
     * 自动完成
     * @var array
     */
    protected $_auto = array(
    );
    

    /*
     * 自动验证
     */
    protected $_validate = array(
     );
    
    /*
     * 获取列表
     */
    public function getManagerList($where){
       $res = $this->alias('manager')
       ->join("{$this->tablePrefix}role AS role ON manager.role_id=role.role_id","LEFT")
       ->where($where)->order('manager.adminuid ASC')->select();
        return $res;
    }
	
    /*
     * 统计数量
     */
    public function getManagerCount($where){
        $res = $this->where($where)->count();
        return $res;
    }
    
    /*
     * 添加
     */
    public function addManager($data){
        $res = $this->add($data);
        return $res;
    }
    
    /*
     * 获取信息
     */
    public function getManager($where){
        $res = $this->where($where)->find();
        return $res;
    }
	
    /*
     * 编辑信息
     */
    public function editManager($where,$data){
        return $this->where($where)->save($data);
    }
    
    
}
